package com.ruoyi.function.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.function.mapper.TollBridgeStatMapper;
import com.ruoyi.function.domain.TollBridgeStat;
import com.ruoyi.function.service.ITollBridgeStatService;

/**
 * 收费桥梁统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-11
 */
@Service
public class TollBridgeStatServiceImpl implements ITollBridgeStatService 
{
    @Autowired
    private TollBridgeStatMapper tollBridgeStatMapper;

    /**
     * 查询收费桥梁统计
     * 
     * @param id 收费桥梁统计主键
     * @return 收费桥梁统计
     */
    @Override
    public TollBridgeStat selectTollBridgeStatById(Long id)
    {
        return tollBridgeStatMapper.selectTollBridgeStatById(id);
    }

    /**
     * 查询收费桥梁统计列表
     * 
     * @param tollBridgeStat 收费桥梁统计
     * @return 收费桥梁统计
     */
    @Override
    public List<TollBridgeStat> selectTollBridgeStatList(TollBridgeStat tollBridgeStat)
    {
        return tollBridgeStatMapper.selectTollBridgeStatList(tollBridgeStat);
    }

    /**
     * 新增收费桥梁统计
     * 
     * @param tollBridgeStat 收费桥梁统计
     * @return 结果
     */
    @Override
    public int insertTollBridgeStat(TollBridgeStat tollBridgeStat)
    {
        return tollBridgeStatMapper.insertTollBridgeStat(tollBridgeStat);
    }

    /**
     * 修改收费桥梁统计
     * 
     * @param tollBridgeStat 收费桥梁统计
     * @return 结果
     */
    @Override
    public int updateTollBridgeStat(TollBridgeStat tollBridgeStat)
    {
        return tollBridgeStatMapper.updateTollBridgeStat(tollBridgeStat);
    }

    /**
     * 批量删除收费桥梁统计
     * 
     * @param ids 需要删除的收费桥梁统计主键
     * @return 结果
     */
    @Override
    public int deleteTollBridgeStatByIds(Long[] ids)
    {
        return tollBridgeStatMapper.deleteTollBridgeStatByIds(ids);
    }

    /**
     * 删除收费桥梁统计信息
     * 
     * @param id 收费桥梁统计主键
     * @return 结果
     */
    @Override
    public int deleteTollBridgeStatById(Long id)
    {
        return tollBridgeStatMapper.deleteTollBridgeStatById(id);
    }
    
    /**
     * 根据ID查询是否有子节点
     * 
     * @param id 节点ID
     * @return 结果
     */
    @Override
    public boolean hasChildById(Long id)
    {
        return tollBridgeStatMapper.hasChildById(id) > 0;
    }
}
